/*
 * RoutingDef.h
 *
 *  Created on: Aug 29, 2012
 *      Author: HUNG
 */

#ifndef ROUTINGDEF_H_
#define ROUTINGDEF_H_

#include "Message_m.h"

#define NUMBERNODES 200
#define NUMTARGET   1       //number target

//Message types
#define SMSG_INIT           1
#define M_SELF_O_M          2
#define M_SELF_T1           3
#define EventNotifyMsg      4
#define DataToBSMsg         5
#define RelayRequestMsg     6
#define AckRelayMsg         7
#define CHSelfMsg           8
#define TDMAMsg             9
#define DataToCHMsg         10
#define SelfTDMAMsg         11
#define StatusInfoMsg       12
#define BackOffSeflMsg          13
#define CCASeflMsg              14
#define CleanChanelSeflMsg      15
#define EnergyRelayInfoMsg      16
#define TurnAroundSeflMsg       17
#define TargetInfoMsg           18
#define NotifySeflMsg           19
#define ScheduleResetSeflMsg    20

#define BROADCAST           "broadcast"
#define TRANSMIT            "transmit"

//Message Length
#define ControlMsgLength    25 * 8   //bit
#define DataMsgLength       128 * 8  //bit
//Energy Consumption
#define Eelec               0.00005
#define Efs                 0.00000001

#define Tactive          0.035       //s
#define Tdetection       0.2

class Package : public cObject
{
    private:
        SensorMessage *msg;
        const char *type;
        double distance;
    public:
        Package(SensorMessage *msg, const char *type, double distance)
    {
            this->msg = msg;
            this->type = type;
            this->distance = distance;
    }

        SensorMessage* getMessage()
        {
            return this->msg;
        }

        const char* getType()
        {
            return this->type;
        }

        double getDistance()
        {
            return distance;
        }
};

#endif /* ROUTINGDEF_H_ */
